package com.foreknow.demo9;

public class Dog implements Animal{

    @Override
    public void eat() {
        System.out.println("eat----------");
    }

    @Override
    public void play() {
        System.out.println("play-----------");

    }

    @Override
    public void sleep() {
        System.out.println("sleep---------");
    }

    public static void main(String[] args) {
        Animal[] animals = new Animal[3];
        animals[0] = new Cat();
        animals[1] = new Dog();

        for (int i = 0; i < animals.length; i++) {
            Animal c = animals[i];
            c.play();
        }
    }
}
